<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html>

	<head>
		<meta charset="utf-8" />
		<!-- 优先使用 IE 最新版本和 Chrome -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<!-- 为移动设备添加 viewport -->
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
		<!--忽略页面中的数字识别为电话，忽略email识别-->
		<meta name="format-detection" content="telphone=no, email=no" />
		<title>国际媒体话语分析平台-首页</title>
		<link rel="stylesheet" type="text/css" href="/css/bootstrap.css" />
		<link rel="stylesheet" type="text/css" href="/css/base.css" />
		<link rel="stylesheet" type="text/css" href="/css/index.css" />
		<!--[if lt IE 9]>
			<script type="text/javascript" src="/js/html5shiv.min.js"></script>
			<script type="text/javascript" src="/js/respond.min.js"></script>
	    <![endif]-->
		<link rel="stylesheet" type="text/css" href="/css/media.css" />
		<link rel="stylesheet" type="text/css" href="/res/layui/css/layui.css">
	</head>

	<body>
		<!--导航-->
		<nav class="navbar navbar-default navbar-fixed-top top-box">
			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed">
				        <span class="sr-only">Toggle navigation</span>
				        <span class="icon-bar"></span>
				        <span class="icon-bar"></span>
				        <span class="icon-bar"></span>
				    </button>
					<h1><a class="navbar-brand" href="#">
						国际媒体话语分析平台
					</a></h1>
				</div>

				<div class="collapse navbar-collapse" >
					<ul class="nav navbar-nav navbar-right top-nav">
						<li class="active">
							<a href="/page/index">
								平台首页
								<span class="sr-only">(current)</span>
							</a>
						</li>
						<li>
							<a href="/page/new-news">最新资讯</a>
						</li>
						<li>
							<a href="/page/new-hot">热点推荐</a>
						</li>
						<li>
							<a href="/page/new-search">信息检索</a>
						</li>
						<li class="search_c"><a href="#">搜索 <i class="glyphicon glyphicon-search"></i></a></li>
						<form>
							<input type="text"  id="keyword" name="keyword" class="form-control search" placeholder="请输入文章关键字或标题">
						</form>
					</ul>
				</div>
				<!-- /.navbar-collapse -->
			</div>
			<!-- /.container -->
		</nav>
		<!--/ 数据分析-->
			<div style="padding: 150px; background-color: #F2F2F2;">
				<div class="layui-row layui-col-space15">
					<div class="layui-col-md6">
						<div class="layui-card">
							<div class="layui-card-header">滚动新闻</div>
							<div class="layui-card-body" style="height: 500px">
								<div class="news-list">
									<div class="news-text" th:each="news : ${schResult.getNews()}">
										<h3><a th:href="'/page/new-con?id='+${news.getId()}" th:utext="${news.getTitle()}"></a></h3>
										<div>
											<a  th:href="'/page/new-con?id='+${news.getId()}" class="read-all">阅读全文</a>
											&nbsp;
											<span><i class="glyphicon"></i>来源:</span>
											<span th:utext="${news.getSource()}"><i class="glyphicon glyphicon-eye-open"></i></span>
											&nbsp;
											<span><i class="glyphicon glyphicon-eye-open"></i>关键词:</span>
											<span class="" th:text="${news.getKeyword()}" style="color: #01AAED;font-size: 100%"><i class="glyphicon glyphicon-heart"></i> </span>
											&nbsp;
											<span><i class="glyphicon"></i>点击量:</span>
											<span th:utext="${news.getOnclick()}"style="color: #ac2925;font-size: 100%"><i class="glyphicon glyphicon-heart"></i></span>
											<span th:utext="${news.getTime()}" class="pull-right" ><i class="glyphicon glyphicon-time"></i> </span>
										</div>
										<fieldset class="layui-elem-field layui-field-title" style="margin-top:5px;">
										</fieldset>
									</div>
								</div>

							</div>
						</div>
					</div>
					<div class="layui-col-md6">
						<div class="layui-card">
							<div class="layui-card-header">
								<div style="float: left">热词聚集</div>
								<div style="float: right">
								<form class="layui-form" action="" lay-filter="wordexample" >
									<div class="layui-input-inline">
										<input type="text" class="layui-input" name="wordnum" id="wordnum" placeholder="高频词个数">
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn layui-btn-normal" id="LAY-word-day">当天</button>
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn layui-btn-normal" id="LAY-word-week">一周内</button>
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn layui-btn-normal" id="LAY-word-month">一月内</button>
									</div>
								</form>
								</div>
							</div>
							<div class="layui-card-body" style="height: 500px">
								<img th:src="${ciyunPath}" height="100%" width="100%" id="ciyunimg">
							</div>
						</div>
					</div>
				</div>
				<div class="layui-row layui-col-space15">
					<div class="layui-col-md12">
						<div class="layui-card">
							<div class="layui-card-header">
								<div style="float: left">全球资讯分布图</div>
								<div style="float: right">
								<form class="layui-form" action="" lay-filter="example">
									<div class="layui-input-inline">
										<input type="text" class="layui-input" name="starttime" id="starttime" placeholder="开始时间">
									</div>
									<div class="layui-input-inline">
										<input type="text" class="layui-input"  name="endtime" id="endtime" placeholder="结束时间">
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn layui-btn-normal" id="LAY-component-form-getval">刷新</button>
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn layui-btn-normal" id="LAY-day">当天</button>
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn layui-btn-normal" id="LAY-week">一周内</button>
									</div>
									<div  class="layui-input-inline">
										<button type="button" class="layui-btn layui-btn-normal" id="LAY-month">一月内</button>
									</div>
								</form>
								</div>
							</div>
							<div class="layui-card-body" style="height:600px">
								<div id="main" style="height:100%"></div>
							</div>
						</div>
					</div>
				</div>
			</div>
		<div class="footer">
			国际化媒体话语分析平台
		</div>
        <script type="text/javascript" src="/res/layui/layui.all.js"></script>
		<script type="text/javascript" src="/js/jquery.js"></script>
		<script type="text/javascript" src="/js/bootstrap.js"></script>
		<script type="text/javascript" src="/js/nav.js"></script>
        <script type="text/javascript" src="/js/search.js"></script>
	    <script type="text/javascript" src="/res/echarts/echarts.min.js"></script>
	    <script type="text/javascript" src="/res/echarts/world/js/world.js"></script>
	    <script type="text/javascript" src="/js/index.js" th:inline="javascript"></script>
	    <script>
			/**获取当天日期*/
			function getNowFormatDate() {
				var date = new Date();
				var seperator1 = "-";
				var year = date.getFullYear();
				var month = date.getMonth() + 1;
				var strDate = date.getDate();
				if (month >= 1 && month <= 9) {
					month = "0" + month;
				}
				if (strDate >= 0 && strDate <= 9) {
					strDate = "0" + strDate;
				}
				var currentdate = year + seperator1 + month + seperator1 + strDate;
				return currentdate;
			}
			/**获取当前一周的开始时间*/
			function getweekstartDate() {
				var now = new Date();
				var year = now.getFullYear();
				var month = now.getMonth() + 1;//0-11表示1-12月
				var day = now.getDate();
				var dateObj = {};
				dateObj.now = year + '-' + month + '-' + day;
				if(day - 7 <= 0){   //如果在当月7日之前
					var lastMonthDay = new Date(year, (parseInt(month) - 1), 0).getDate();    //1周前所在月的总天数
					if(month - 1 <= 0){ //如果在当年的1月份
						dateObj.last = (year - 1) + '-' + 12 + '-' + (31 - (7 - day));
					}else{
						dateObj.last = year + '-' + (month - 1) + '-' + (lastMonthDay - (7 - day));
					}
				}else{
					dateObj.last = year + '-' + month + '-' + (day -7);
				}
				return dateObj.last;
			}
			/**获取当前一周的结束时间*/
			function getweekendDate() {
				var now = new Date();
				var year = now.getFullYear();
				var month = now.getMonth() + 1;//0-11表示1-12月
				var day = now.getDate();
				var dateObj = {};
				dateObj.now = year + '-' + month + '-' + day;
				if(day - 7 <= 0){   //如果在当月7日之前
					var lastMonthDay = new Date(year, (parseInt(month) - 1), 0).getDate();    //1周前所在月的总天数
					if(month - 1 <= 0){ //如果在当年的1月份
						dateObj.last = (year - 1) + '-' + 12 + '-' + (31 - (7 - day));
					}else{
						dateObj.last = year + '-' + (month - 1) + '-' + (lastMonthDay - (7 - day));
					}
				}else{
					dateObj.last = year + '-' + month + '-' + (day -7);
				}
				return dateObj.now;
			}
			/**根据年月获取近一个月*/
			function getmothStartDate(){
				var now = new Date();
				var year = now.getFullYear();
				var month = now.getMonth() + 1;//0-11表示1-12月
				var day = now.getDate();
				var dateObj = {};
				dateObj.now = year + '-' + month + '-' + day;
				var nowMonthDay = new Date(year, month, 0).getDate();    //当前月的总天数
				if(month - 1 <= 0){ //如果是1月，年数往前推一年<br>　　　　
					dateObj.last = (year - 1) + '-' + 12 + '-' + day;
				}else{
					var lastMonthDay = new Date(year, (parseInt(month) - 1), 0).getDate();
					if(lastMonthDay < day){    //1个月前所在月的总天数小于现在的天日期
						if(day < nowMonthDay){        //当前天日期小于当前月总天数
							dateObj.last = year + '-' + (month - 1) + '-' + (lastMonthDay - (nowMonthDay - day));
						}else{
							dateObj.last = year + '-' + (month - 1) + '-' + lastMonthDay;
						}
					}else{
						dateObj.last = year + '-' + (month - 1) + '-' + day;
					}
				}
				return dateObj.last;
			}
			function getmothEndDate(){
				var now = new Date();
				var year = now.getFullYear();
				var month = now.getMonth() + 1;//0-11表示1-12月
				var day = now.getDate();
				var dateObj = {};
				dateObj.now = year + '-' + month + '-' + day;
				var nowMonthDay = new Date(year, month, 0).getDate();    //当前月的总天数
				if(month - 1 <= 0){ //如果是1月，年数往前推一年<br>　　　　
					dateObj.last = (year - 1) + '-' + 12 + '-' + day;
				}else{
					var lastMonthDay = new Date(year, (parseInt(month) - 1), 0).getDate();
					if(lastMonthDay < day){    //1个月前所在月的总天数小于现在的天日期
						if(day < nowMonthDay){        //当前天日期小于当前月总天数
							dateObj.last = year + '-' + (month - 1) + '-' + (lastMonthDay - (nowMonthDay - day));
						}else{
							dateObj.last = year + '-' + (month - 1) + '-' + lastMonthDay;
						}
					}else{
						dateObj.last = year + '-' + (month - 1) + '-' + day;
					}
				}
				return dateObj.now;
			}

			layui.use(['form', 'laydate'], function(){
				var form = layui.form
						,laydate = layui.laydate;
				var myChart = echarts.init(document.getElementById('main'));
				//日期
				laydate.render({
					elem: '#starttime'
				});
				laydate.render({
					elem: '#endtime'
				});
				//热词
				layui.$('#LAY-word-day').on('click', function(){
					var starttime = getNowFormatDate()
					var endtime = getNowFormatDate()
					var wordnum = document.getElementById("wordnum")
					var wordnumvalue=wordnum.value.replace(/[^0-9]/ig,"");
					if (wordnumvalue == '' || wordnumvalue == undefined || wordnumvalue == null) {
						wordnumvalue=100
					}
					$.ajax({
						url:'/index/hotword?starttime='+starttime+"&endtime="+endtime+"&wordnum="+wordnumvalue,
						method:'get',
						success:function(datavalue){
						console.log(datavalue)
						document.getElementById("ciyunimg").src = datavalue;

						}
					})
				});
				layui.$('#LAY-word-week').on('click', function(){
					var starttime = getweekstartDate()
					var endtime = getweekendDate()
					var wordnum = document.getElementById("wordnum")
					var wordnumvalue=wordnum.value.replace(/[^0-9]/ig,"");
					if (wordnumvalue == '' || wordnumvalue == undefined || wordnumvalue == null) {
						wordnumvalue=100
					}
					$.ajax({
						url:'/index/hotword?starttime='+starttime+"&endtime="+endtime+"&wordnum="+wordnumvalue,
						method:'get',
						success:function(datavalue){
							console.log(datavalue)
							document.getElementById("ciyunimg").src = datavalue;
						}
					})
				});
				layui.$('#LAY-word-month').on('click', function(){
					var starttime = getmothStartDate()
					var endtime = getmothEndDate();
					var wordnum = document.getElementById("wordnum")
					var wordnumvalue=wordnum.value.replace(/[^0-9]/ig,"");
					if (wordnumvalue == '' || wordnumvalue == undefined || wordnumvalue == null) {
						wordnumvalue=100
					}
					$.ajax({
						url:'/index/hotword?starttime='+starttime+"&endtime="+endtime+"&wordnum="+wordnumvalue,
						method:'get',
						success:function(datavalue){
							console.log(datavalue)
							document.getElementById("ciyunimg").src = datavalue;
						}
					})
				});
				//图表
				layui.$('#LAY-component-form-getval').on('click', function(){
					var starttime = document.getElementById("starttime")
					var endtime = document.getElementById("endtime")
					console.log(starttime.value+"---"+endtime.value)
					myChart.showLoading();
					$.ajax({
						url:'/index/data?starttime='+starttime.value+"&endtime="+endtime.value,
						method:'get',
						success:function(datavalue){
							myChart.hideLoading();
							myChart.setOption({
								title: {
									left: 'center',
									top: 'top'
								},
								tooltip: {
									trigger: 'item',
									formatter: function (params) {
										var value = (params.value);
										return params.seriesName + '<br/>' + params.name + ' : ' + value;
									}
								},
								visualMap: {
									min: 0,
									max: 1000,
									text:['1000+','低'],
									realtime: false,
									calculable: true,
									color: ['orangered','yellow','lightskyblue']
								},
								toolbox: {
									show: true,
									orient: 'vertical',
									left: 'left',
									top: 'top',
									feature: {
										dataView: {readOnly: false},
										restore: {},
										saveAsImage: {}
									}
								},
								series: [
									{
										name: '新闻数量',
										type: 'map',
										mapType: 'world',
										roam: true,
										itemStyle:{
											emphasis:{label:{show:true}},
										},
										data: JSON.parse(datavalue),
										nameMap: {
											"Afghanistan":"阿富汗",
											"Albania":"阿尔巴尼亚",
											"Algeria":"阿尔及利亚",
											"Angola":"安哥拉",
											"Argentina":"阿根廷",
											"Armenia":"亚美尼亚",
											"Australia":"澳大利亚",
											"Austria":"奥地利",
											"Azerbaijan":"阿塞拜疆",
											"Bahamas":"巴哈马",
											"Bahrain":"巴林",
											"Bangladesh":"孟加拉国",
											"Belarus":"白俄罗斯",
											"Belgium":"比利时",
											"Belize":"伯利兹",
											"Benin":"贝宁",
											"Bhutan":"不丹",
											"Bolivia":"玻利维亚",
											"Bosnia and Herz.":"波斯尼亚和黑塞哥维那",
											"Botswana":"博茨瓦纳",
											"Brazil":"巴西",
											"British Virgin Islands":"英属维京群岛",
											"Brunei":"文莱",
											"Bulgaria":"保加利亚",
											"Burkina Faso":"布基纳法索",
											"Burundi":"布隆迪",
											"Cambodia":"柬埔寨",
											"Cameroon":"喀麦隆",
											"Canada":"加拿大",
											"Cape Verde":"佛得角",
											"Cayman Islands":"开曼群岛",
											"Central African Rep.":"中非共和国",
											"Chad":"乍得",
											"Chile":"智利",
											"China":"中国",
											"Colombia":"哥伦比亚",
											"Comoros":"科摩罗",
											"Congo":"刚果",
											"Costa Rica":"哥斯达黎加",
											"Croatia":"克罗地亚",
											"Cuba":"古巴",
											"Cyprus":"塞浦路斯",
											"Czech Rep.":"捷克共和国",
											"Côte d'Ivoire":"科特迪瓦",
											"Dem. Rep. Congo":"刚果民主共和国",
											"Dem. Rep. Korea":"朝鲜",
											"Denmark":"丹麦",
											"Djibouti":"吉布提",
											"Dominican Rep.":"多米尼加共和国",
											"Ecuador":"厄瓜多尔",
											"Egypt":"埃及",
											"El Salvador":"萨尔瓦多",
											"Equatorial Guinea":"赤道几内亚",
											"Eritrea":"厄立特里亚",
											"Estonia":"爱沙尼亚",
											"Ethiopia":"埃塞俄比亚",
											"Falkland Is.":"福克兰群岛",
											"Fiji":"斐济",
											"Finland":"芬兰",
											"Fr. S. Antarctic Lands":"所罗门群岛",
											"France":"法国",
											"Gabon":"加蓬",
											"Gambia":"冈比亚",
											"Georgia":"格鲁吉亚",
											"Germany":"德国",
											"Ghana":"加纳",
											"Greece":"希腊",
											"Greenland":"格陵兰",
											"Guatemala":"危地马拉",
											"Guinea":"几内亚",
											"Guinea-Bissau":"几内亚比绍",
											"Guyana":"圭亚那",
											"Haiti":"海地",
											"Honduras":"洪都拉斯",
											"Hungary":"匈牙利",
											"Iceland":"冰岛",
											"India":"印度",
											"Indonesia":"印度尼西亚",
											"Iran":"伊朗",
											"Iraq":"伊拉克",
											"Ireland":"爱尔兰",
											"Isle of Man":"马恩岛",
											"Israel":"以色列",
											"Italy":"意大利",
											"Jamaica":"牙买加",
											"Japan":"日本",
											"Jordan":"约旦",
											"Kazakhstan":"哈萨克斯坦",
											"Kenya":"肯尼亚",
											"Korea":"韩国",
											"Kuwait":"科威特",
											"Kyrgyzstan":"吉尔吉斯斯坦",
											"Lao PDR":"老挝",
											"Latvia":"拉脱维亚",
											"Lebanon":"黎巴嫩",
											"Lesotho":"莱索托",
											"Liberia":"利比里亚",
											"Libya":"利比亚",
											"Lithuania":"立陶宛",
											"Luxembourg":"卢森堡",
											"Macedonia":"马其顿",
											"Madagascar":"马达加斯加",
											"Malawi":"马拉维",
											"Malaysia":"马来西亚",
											"Maldives":"马尔代夫",
											"Mali":"马里",
											"Malta":"马耳他",
											"Mauritania":"毛利塔尼亚",
											"Mauritius":"毛里求斯",
											"Mexico":"墨西哥",
											"Moldova":"摩尔多瓦",
											"Monaco":"摩纳哥",
											"Mongolia":"蒙古",
											"Montenegro":"黑山共和国",
											"Morocco":"摩洛哥",
											"Mozambique":"莫桑比克",
											"Myanmar":"缅甸",
											"Namibia":"纳米比亚",
											"Nepal":"尼泊尔",
											"Netherlands":"荷兰",
											"New Caledonia":"新喀里多尼亚",
											"New Zealand":"新西兰",
											"Nicaragua":"尼加拉瓜",
											"Niger":"尼日尔",
											"Nigeria":"尼日利亚",
											"Norway":"挪威",
											"Oman":"阿曼",
											"Pakistan":"巴基斯坦",
											"Panama":"巴拿马",
											"Papua New Guinea":"巴布亚新几内亚",
											"Paraguay":"巴拉圭",
											"Peru":"秘鲁",
											"Philippines":"菲律宾",
											"Poland":"波兰",
											"Portugal":"葡萄牙",
											"Puerto Rico":"波多黎各",
											"Qatar":"卡塔尔",
											"Reunion":"留尼旺",
											"Romania":"罗马尼亚",
											"Russia":"俄罗斯",
											"Rwanda":"卢旺达",
											"S. Geo. and S. Sandw. Is.":"南乔治亚和南桑威奇群岛",
											"S. Sudan":"南苏丹",
											"San Marino":"圣马力诺",
											"Saudi Arabia":"沙特阿拉伯",
											"Senegal":"塞内加尔",
											"Serbia":"塞尔维亚",
											"Sierra Leone":"塞拉利昂",
											"Singapore":"新加坡",
											"Slovakia":"斯洛伐克",
											"Slovenia":"斯洛文尼亚",
											"Solomon Is.":"所罗门群岛",
											"Somalia":"索马里",
											"South Africa":"南非",
											"Spain":"西班牙",
											"Sri Lanka":"斯里兰卡",
											"Sudan":"苏丹",
											"Suriname":"苏里南",
											"Swaziland":"斯威士兰",
											"Sweden":"瑞典",
											"Switzerland":"瑞士",
											"Syria":"叙利亚",
											"Tajikistan":"塔吉克斯坦",
											"Tanzania":"坦桑尼亚",
											"Thailand":"泰国",
											"Togo":"多哥",
											"Tonga":"汤加",
											"Trinidad and Tobago":"特立尼达和多巴哥",
											"Tunisia":"突尼斯",
											"Turkey":"土耳其",
											"Turkmenistan":"土库曼斯坦",
											"U.S. Virgin Islands":"美属维尔京群岛",
											"Uganda":"乌干达",
											"Ukraine":"乌克兰",
											"United Arab Emirates":"阿拉伯联合酋长国",
											"United Kingdom":"英国",
											"United States":"美国",
											"Uruguay":"乌拉圭",
											"Uzbekistan":"乌兹别克斯坦",
											"Vanuatu":"瓦努阿图",
											"Vatican City":"梵蒂冈城",
											"Venezuela":"委内瑞拉",
											"Vietnam":"越南",
											"W. Sahara":"西撒哈拉",
											"Yemen":"也门",
											"Yugoslavia":"南斯拉夫",
											"Zaire":"扎伊尔",
											"Zambia":"赞比亚",
											"Zimbabwe":"津巴布韦"
										}
									}
								]
							})
						}
					})
				});
				layui.$('#LAY-day').on('click', function(){
					var starttime = getNowFormatDate()
					var endtime = getNowFormatDate()
					console.log(starttime+"---"+endtime)
					document.getElementById('starttime').value=starttime;
					document.getElementById('endtime').value=endtime;
					myChart.showLoading();
					$.ajax({
						url:'/index/data?starttime='+starttime+"&endtime="+endtime,
						method:'get',
						success:function(datavalue){
							myChart.hideLoading();
							myChart.setOption({
								title: {
									left: 'center',
									top: 'top'
								},
								tooltip: {
									trigger: 'item',
									formatter: function (params) {
										var value = (params.value);
										return params.seriesName + '<br/>' + params.name + ' : ' + value;
									}
								},
								visualMap: {
									min: 0,
									max: 1000,
									text:['1000+','低'],
									realtime: false,
									calculable: true,
									color: ['orangered','yellow','lightskyblue']
								},
								toolbox: {
									show: true,
									orient: 'vertical',
									left: 'left',
									top: 'top',
									feature: {
										dataView: {readOnly: false},
										restore: {},
										saveAsImage: {}
									}
								},
								series: [
									{
										name: '新闻数量',
										type: 'map',
										mapType: 'world',
										roam: true,
										itemStyle:{
											emphasis:{label:{show:true}},
										},
										data: JSON.parse(datavalue),
										nameMap: {
											"Afghanistan":"阿富汗",
											"Albania":"阿尔巴尼亚",
											"Algeria":"阿尔及利亚",
											"Angola":"安哥拉",
											"Argentina":"阿根廷",
											"Armenia":"亚美尼亚",
											"Australia":"澳大利亚",
											"Austria":"奥地利",
											"Azerbaijan":"阿塞拜疆",
											"Bahamas":"巴哈马",
											"Bahrain":"巴林",
											"Bangladesh":"孟加拉国",
											"Belarus":"白俄罗斯",
											"Belgium":"比利时",
											"Belize":"伯利兹",
											"Benin":"贝宁",
											"Bhutan":"不丹",
											"Bolivia":"玻利维亚",
											"Bosnia and Herz.":"波斯尼亚和黑塞哥维那",
											"Botswana":"博茨瓦纳",
											"Brazil":"巴西",
											"British Virgin Islands":"英属维京群岛",
											"Brunei":"文莱",
											"Bulgaria":"保加利亚",
											"Burkina Faso":"布基纳法索",
											"Burundi":"布隆迪",
											"Cambodia":"柬埔寨",
											"Cameroon":"喀麦隆",
											"Canada":"加拿大",
											"Cape Verde":"佛得角",
											"Cayman Islands":"开曼群岛",
											"Central African Rep.":"中非共和国",
											"Chad":"乍得",
											"Chile":"智利",
											"China":"中国",
											"Colombia":"哥伦比亚",
											"Comoros":"科摩罗",
											"Congo":"刚果",
											"Costa Rica":"哥斯达黎加",
											"Croatia":"克罗地亚",
											"Cuba":"古巴",
											"Cyprus":"塞浦路斯",
											"Czech Rep.":"捷克共和国",
											"Côte d'Ivoire":"科特迪瓦",
											"Dem. Rep. Congo":"刚果民主共和国",
											"Dem. Rep. Korea":"朝鲜",
											"Denmark":"丹麦",
											"Djibouti":"吉布提",
											"Dominican Rep.":"多米尼加共和国",
											"Ecuador":"厄瓜多尔",
											"Egypt":"埃及",
											"El Salvador":"萨尔瓦多",
											"Equatorial Guinea":"赤道几内亚",
											"Eritrea":"厄立特里亚",
											"Estonia":"爱沙尼亚",
											"Ethiopia":"埃塞俄比亚",
											"Falkland Is.":"福克兰群岛",
											"Fiji":"斐济",
											"Finland":"芬兰",
											"Fr. S. Antarctic Lands":"所罗门群岛",
											"France":"法国",
											"Gabon":"加蓬",
											"Gambia":"冈比亚",
											"Georgia":"格鲁吉亚",
											"Germany":"德国",
											"Ghana":"加纳",
											"Greece":"希腊",
											"Greenland":"格陵兰",
											"Guatemala":"危地马拉",
											"Guinea":"几内亚",
											"Guinea-Bissau":"几内亚比绍",
											"Guyana":"圭亚那",
											"Haiti":"海地",
											"Honduras":"洪都拉斯",
											"Hungary":"匈牙利",
											"Iceland":"冰岛",
											"India":"印度",
											"Indonesia":"印度尼西亚",
											"Iran":"伊朗",
											"Iraq":"伊拉克",
											"Ireland":"爱尔兰",
											"Isle of Man":"马恩岛",
											"Israel":"以色列",
											"Italy":"意大利",
											"Jamaica":"牙买加",
											"Japan":"日本",
											"Jordan":"约旦",
											"Kazakhstan":"哈萨克斯坦",
											"Kenya":"肯尼亚",
											"Korea":"韩国",
											"Kuwait":"科威特",
											"Kyrgyzstan":"吉尔吉斯斯坦",
											"Lao PDR":"老挝",
											"Latvia":"拉脱维亚",
											"Lebanon":"黎巴嫩",
											"Lesotho":"莱索托",
											"Liberia":"利比里亚",
											"Libya":"利比亚",
											"Lithuania":"立陶宛",
											"Luxembourg":"卢森堡",
											"Macedonia":"马其顿",
											"Madagascar":"马达加斯加",
											"Malawi":"马拉维",
											"Malaysia":"马来西亚",
											"Maldives":"马尔代夫",
											"Mali":"马里",
											"Malta":"马耳他",
											"Mauritania":"毛利塔尼亚",
											"Mauritius":"毛里求斯",
											"Mexico":"墨西哥",
											"Moldova":"摩尔多瓦",
											"Monaco":"摩纳哥",
											"Mongolia":"蒙古",
											"Montenegro":"黑山共和国",
											"Morocco":"摩洛哥",
											"Mozambique":"莫桑比克",
											"Myanmar":"缅甸",
											"Namibia":"纳米比亚",
											"Nepal":"尼泊尔",
											"Netherlands":"荷兰",
											"New Caledonia":"新喀里多尼亚",
											"New Zealand":"新西兰",
											"Nicaragua":"尼加拉瓜",
											"Niger":"尼日尔",
											"Nigeria":"尼日利亚",
											"Norway":"挪威",
											"Oman":"阿曼",
											"Pakistan":"巴基斯坦",
											"Panama":"巴拿马",
											"Papua New Guinea":"巴布亚新几内亚",
											"Paraguay":"巴拉圭",
											"Peru":"秘鲁",
											"Philippines":"菲律宾",
											"Poland":"波兰",
											"Portugal":"葡萄牙",
											"Puerto Rico":"波多黎各",
											"Qatar":"卡塔尔",
											"Reunion":"留尼旺",
											"Romania":"罗马尼亚",
											"Russia":"俄罗斯",
											"Rwanda":"卢旺达",
											"S. Geo. and S. Sandw. Is.":"南乔治亚和南桑威奇群岛",
											"S. Sudan":"南苏丹",
											"San Marino":"圣马力诺",
											"Saudi Arabia":"沙特阿拉伯",
											"Senegal":"塞内加尔",
											"Serbia":"塞尔维亚",
											"Sierra Leone":"塞拉利昂",
											"Singapore":"新加坡",
											"Slovakia":"斯洛伐克",
											"Slovenia":"斯洛文尼亚",
											"Solomon Is.":"所罗门群岛",
											"Somalia":"索马里",
											"South Africa":"南非",
											"Spain":"西班牙",
											"Sri Lanka":"斯里兰卡",
											"Sudan":"苏丹",
											"Suriname":"苏里南",
											"Swaziland":"斯威士兰",
											"Sweden":"瑞典",
											"Switzerland":"瑞士",
											"Syria":"叙利亚",
											"Tajikistan":"塔吉克斯坦",
											"Tanzania":"坦桑尼亚",
											"Thailand":"泰国",
											"Togo":"多哥",
											"Tonga":"汤加",
											"Trinidad and Tobago":"特立尼达和多巴哥",
											"Tunisia":"突尼斯",
											"Turkey":"土耳其",
											"Turkmenistan":"土库曼斯坦",
											"U.S. Virgin Islands":"美属维尔京群岛",
											"Uganda":"乌干达",
											"Ukraine":"乌克兰",
											"United Arab Emirates":"阿拉伯联合酋长国",
											"United Kingdom":"英国",
											"United States":"美国",
											"Uruguay":"乌拉圭",
											"Uzbekistan":"乌兹别克斯坦",
											"Vanuatu":"瓦努阿图",
											"Vatican City":"梵蒂冈城",
											"Venezuela":"委内瑞拉",
											"Vietnam":"越南",
											"W. Sahara":"西撒哈拉",
											"Yemen":"也门",
											"Yugoslavia":"南斯拉夫",
											"Zaire":"扎伊尔",
											"Zambia":"赞比亚",
											"Zimbabwe":"津巴布韦"
										}
									}
								]
							})
						}
					})
				});
				layui.$('#LAY-week').on('click', function(){
					var starttime = getweekstartDate()
					var endtime = getweekendDate()
					console.log(starttime+"---"+endtime)
					document.getElementById('starttime').value=starttime;
					document.getElementById('endtime').value=endtime;
					myChart.showLoading();
					$.ajax({
						url:'/index/data?starttime='+starttime+"&endtime="+endtime,
						method:'get',
						success:function(datavalue){
							myChart.hideLoading();
							myChart.setOption({
								title: {
									left: 'center',
									top: 'top'
								},
								tooltip: {
									trigger: 'item',
									formatter: function (params) {
										var value = (params.value);
										return params.seriesName + '<br/>' + params.name + ' : ' + value;
									}
								},
								visualMap: {
									min: 0,
									max: 1000,
									text:['1000+','低'],
									realtime: false,
									calculable: true,
									color: ['orangered','yellow','lightskyblue']
								},
								toolbox: {
									show: true,
									orient: 'vertical',
									left: 'left',
									top: 'top',
									feature: {
										dataView: {readOnly: false},
										restore: {},
										saveAsImage: {}
									}
								},
								series: [
									{
										name: '新闻数量',
										type: 'map',
										mapType: 'world',
										roam: true,
										itemStyle:{
											emphasis:{label:{show:true}},
										},
										data: JSON.parse(datavalue),
										nameMap: {
											"Afghanistan":"阿富汗",
											"Albania":"阿尔巴尼亚",
											"Algeria":"阿尔及利亚",
											"Angola":"安哥拉",
											"Argentina":"阿根廷",
											"Armenia":"亚美尼亚",
											"Australia":"澳大利亚",
											"Austria":"奥地利",
											"Azerbaijan":"阿塞拜疆",
											"Bahamas":"巴哈马",
											"Bahrain":"巴林",
											"Bangladesh":"孟加拉国",
											"Belarus":"白俄罗斯",
											"Belgium":"比利时",
											"Belize":"伯利兹",
											"Benin":"贝宁",
											"Bhutan":"不丹",
											"Bolivia":"玻利维亚",
											"Bosnia and Herz.":"波斯尼亚和黑塞哥维那",
											"Botswana":"博茨瓦纳",
											"Brazil":"巴西",
											"British Virgin Islands":"英属维京群岛",
											"Brunei":"文莱",
											"Bulgaria":"保加利亚",
											"Burkina Faso":"布基纳法索",
											"Burundi":"布隆迪",
											"Cambodia":"柬埔寨",
											"Cameroon":"喀麦隆",
											"Canada":"加拿大",
											"Cape Verde":"佛得角",
											"Cayman Islands":"开曼群岛",
											"Central African Rep.":"中非共和国",
											"Chad":"乍得",
											"Chile":"智利",
											"China":"中国",
											"Colombia":"哥伦比亚",
											"Comoros":"科摩罗",
											"Congo":"刚果",
											"Costa Rica":"哥斯达黎加",
											"Croatia":"克罗地亚",
											"Cuba":"古巴",
											"Cyprus":"塞浦路斯",
											"Czech Rep.":"捷克共和国",
											"Côte d'Ivoire":"科特迪瓦",
											"Dem. Rep. Congo":"刚果民主共和国",
											"Dem. Rep. Korea":"朝鲜",
											"Denmark":"丹麦",
											"Djibouti":"吉布提",
											"Dominican Rep.":"多米尼加共和国",
											"Ecuador":"厄瓜多尔",
											"Egypt":"埃及",
											"El Salvador":"萨尔瓦多",
											"Equatorial Guinea":"赤道几内亚",
											"Eritrea":"厄立特里亚",
											"Estonia":"爱沙尼亚",
											"Ethiopia":"埃塞俄比亚",
											"Falkland Is.":"福克兰群岛",
											"Fiji":"斐济",
											"Finland":"芬兰",
											"Fr. S. Antarctic Lands":"所罗门群岛",
											"France":"法国",
											"Gabon":"加蓬",
											"Gambia":"冈比亚",
											"Georgia":"格鲁吉亚",
											"Germany":"德国",
											"Ghana":"加纳",
											"Greece":"希腊",
											"Greenland":"格陵兰",
											"Guatemala":"危地马拉",
											"Guinea":"几内亚",
											"Guinea-Bissau":"几内亚比绍",
											"Guyana":"圭亚那",
											"Haiti":"海地",
											"Honduras":"洪都拉斯",
											"Hungary":"匈牙利",
											"Iceland":"冰岛",
											"India":"印度",
											"Indonesia":"印度尼西亚",
											"Iran":"伊朗",
											"Iraq":"伊拉克",
											"Ireland":"爱尔兰",
											"Isle of Man":"马恩岛",
											"Israel":"以色列",
											"Italy":"意大利",
											"Jamaica":"牙买加",
											"Japan":"日本",
											"Jordan":"约旦",
											"Kazakhstan":"哈萨克斯坦",
											"Kenya":"肯尼亚",
											"Korea":"韩国",
											"Kuwait":"科威特",
											"Kyrgyzstan":"吉尔吉斯斯坦",
											"Lao PDR":"老挝",
											"Latvia":"拉脱维亚",
											"Lebanon":"黎巴嫩",
											"Lesotho":"莱索托",
											"Liberia":"利比里亚",
											"Libya":"利比亚",
											"Lithuania":"立陶宛",
											"Luxembourg":"卢森堡",
											"Macedonia":"马其顿",
											"Madagascar":"马达加斯加",
											"Malawi":"马拉维",
											"Malaysia":"马来西亚",
											"Maldives":"马尔代夫",
											"Mali":"马里",
											"Malta":"马耳他",
											"Mauritania":"毛利塔尼亚",
											"Mauritius":"毛里求斯",
											"Mexico":"墨西哥",
											"Moldova":"摩尔多瓦",
											"Monaco":"摩纳哥",
											"Mongolia":"蒙古",
											"Montenegro":"黑山共和国",
											"Morocco":"摩洛哥",
											"Mozambique":"莫桑比克",
											"Myanmar":"缅甸",
											"Namibia":"纳米比亚",
											"Nepal":"尼泊尔",
											"Netherlands":"荷兰",
											"New Caledonia":"新喀里多尼亚",
											"New Zealand":"新西兰",
											"Nicaragua":"尼加拉瓜",
											"Niger":"尼日尔",
											"Nigeria":"尼日利亚",
											"Norway":"挪威",
											"Oman":"阿曼",
											"Pakistan":"巴基斯坦",
											"Panama":"巴拿马",
											"Papua New Guinea":"巴布亚新几内亚",
											"Paraguay":"巴拉圭",
											"Peru":"秘鲁",
											"Philippines":"菲律宾",
											"Poland":"波兰",
											"Portugal":"葡萄牙",
											"Puerto Rico":"波多黎各",
											"Qatar":"卡塔尔",
											"Reunion":"留尼旺",
											"Romania":"罗马尼亚",
											"Russia":"俄罗斯",
											"Rwanda":"卢旺达",
											"S. Geo. and S. Sandw. Is.":"南乔治亚和南桑威奇群岛",
											"S. Sudan":"南苏丹",
											"San Marino":"圣马力诺",
											"Saudi Arabia":"沙特阿拉伯",
											"Senegal":"塞内加尔",
											"Serbia":"塞尔维亚",
											"Sierra Leone":"塞拉利昂",
											"Singapore":"新加坡",
											"Slovakia":"斯洛伐克",
											"Slovenia":"斯洛文尼亚",
											"Solomon Is.":"所罗门群岛",
											"Somalia":"索马里",
											"South Africa":"南非",
											"Spain":"西班牙",
											"Sri Lanka":"斯里兰卡",
											"Sudan":"苏丹",
											"Suriname":"苏里南",
											"Swaziland":"斯威士兰",
											"Sweden":"瑞典",
											"Switzerland":"瑞士",
											"Syria":"叙利亚",
											"Tajikistan":"塔吉克斯坦",
											"Tanzania":"坦桑尼亚",
											"Thailand":"泰国",
											"Togo":"多哥",
											"Tonga":"汤加",
											"Trinidad and Tobago":"特立尼达和多巴哥",
											"Tunisia":"突尼斯",
											"Turkey":"土耳其",
											"Turkmenistan":"土库曼斯坦",
											"U.S. Virgin Islands":"美属维尔京群岛",
											"Uganda":"乌干达",
											"Ukraine":"乌克兰",
											"United Arab Emirates":"阿拉伯联合酋长国",
											"United Kingdom":"英国",
											"United States":"美国",
											"Uruguay":"乌拉圭",
											"Uzbekistan":"乌兹别克斯坦",
											"Vanuatu":"瓦努阿图",
											"Vatican City":"梵蒂冈城",
											"Venezuela":"委内瑞拉",
											"Vietnam":"越南",
											"W. Sahara":"西撒哈拉",
											"Yemen":"也门",
											"Yugoslavia":"南斯拉夫",
											"Zaire":"扎伊尔",
											"Zambia":"赞比亚",
											"Zimbabwe":"津巴布韦"
										}
									}
								]
							})
						}
					})
				});
				layui.$('#LAY-month').on('click', function(){
					var starttime = getmothStartDate()
					var endtime = getmothEndDate();
					console.log(starttime+"---"+endtime)
					document.getElementById('starttime').value=starttime;
					document.getElementById('endtime').value=endtime;
					myChart.showLoading();
					$.ajax({
						url:'/index/data?starttime='+starttime+"&endtime="+endtime,
						method:'get',
						success:function(datavalue){
							myChart.hideLoading();
							myChart.setOption({
								title: {
									left: 'center',
									top: 'top'
								},
								tooltip: {
									trigger: 'item',
									formatter: function (params) {
										var value = (params.value);
										return params.seriesName + '<br/>' + params.name + ' : ' + value;
									}
								},
								visualMap: {
									min: 0,
									max: 1000,
									text:['1000+','低'],
									realtime: false,
									calculable: true,
									color: ['orangered','yellow','lightskyblue']
								},
								toolbox: {
									show: true,
									orient: 'vertical',
									left: 'left',
									top: 'top',
									feature: {
										dataView: {readOnly: false},
										restore: {},
										saveAsImage: {}
									}
								},
								series: [
									{
										name: '新闻数量',
										type: 'map',
										mapType: 'world',
										roam: true,
										itemStyle:{
											emphasis:{label:{show:true}},
										},
										data: JSON.parse(datavalue),
										nameMap: {
											"Afghanistan":"阿富汗",
											"Albania":"阿尔巴尼亚",
											"Algeria":"阿尔及利亚",
											"Angola":"安哥拉",
											"Argentina":"阿根廷",
											"Armenia":"亚美尼亚",
											"Australia":"澳大利亚",
											"Austria":"奥地利",
											"Azerbaijan":"阿塞拜疆",
											"Bahamas":"巴哈马",
											"Bahrain":"巴林",
											"Bangladesh":"孟加拉国",
											"Belarus":"白俄罗斯",
											"Belgium":"比利时",
											"Belize":"伯利兹",
											"Benin":"贝宁",
											"Bhutan":"不丹",
											"Bolivia":"玻利维亚",
											"Bosnia and Herz.":"波斯尼亚和黑塞哥维那",
											"Botswana":"博茨瓦纳",
											"Brazil":"巴西",
											"British Virgin Islands":"英属维京群岛",
											"Brunei":"文莱",
											"Bulgaria":"保加利亚",
											"Burkina Faso":"布基纳法索",
											"Burundi":"布隆迪",
											"Cambodia":"柬埔寨",
											"Cameroon":"喀麦隆",
											"Canada":"加拿大",
											"Cape Verde":"佛得角",
											"Cayman Islands":"开曼群岛",
											"Central African Rep.":"中非共和国",
											"Chad":"乍得",
											"Chile":"智利",
											"China":"中国",
											"Colombia":"哥伦比亚",
											"Comoros":"科摩罗",
											"Congo":"刚果",
											"Costa Rica":"哥斯达黎加",
											"Croatia":"克罗地亚",
											"Cuba":"古巴",
											"Cyprus":"塞浦路斯",
											"Czech Rep.":"捷克共和国",
											"Côte d'Ivoire":"科特迪瓦",
											"Dem. Rep. Congo":"刚果民主共和国",
											"Dem. Rep. Korea":"朝鲜",
											"Denmark":"丹麦",
											"Djibouti":"吉布提",
											"Dominican Rep.":"多米尼加共和国",
											"Ecuador":"厄瓜多尔",
											"Egypt":"埃及",
											"El Salvador":"萨尔瓦多",
											"Equatorial Guinea":"赤道几内亚",
											"Eritrea":"厄立特里亚",
											"Estonia":"爱沙尼亚",
											"Ethiopia":"埃塞俄比亚",
											"Falkland Is.":"福克兰群岛",
											"Fiji":"斐济",
											"Finland":"芬兰",
											"Fr. S. Antarctic Lands":"所罗门群岛",
											"France":"法国",
											"Gabon":"加蓬",
											"Gambia":"冈比亚",
											"Georgia":"格鲁吉亚",
											"Germany":"德国",
											"Ghana":"加纳",
											"Greece":"希腊",
											"Greenland":"格陵兰",
											"Guatemala":"危地马拉",
											"Guinea":"几内亚",
											"Guinea-Bissau":"几内亚比绍",
											"Guyana":"圭亚那",
											"Haiti":"海地",
											"Honduras":"洪都拉斯",
											"Hungary":"匈牙利",
											"Iceland":"冰岛",
											"India":"印度",
											"Indonesia":"印度尼西亚",
											"Iran":"伊朗",
											"Iraq":"伊拉克",
											"Ireland":"爱尔兰",
											"Isle of Man":"马恩岛",
											"Israel":"以色列",
											"Italy":"意大利",
											"Jamaica":"牙买加",
											"Japan":"日本",
											"Jordan":"约旦",
											"Kazakhstan":"哈萨克斯坦",
											"Kenya":"肯尼亚",
											"Korea":"韩国",
											"Kuwait":"科威特",
											"Kyrgyzstan":"吉尔吉斯斯坦",
											"Lao PDR":"老挝",
											"Latvia":"拉脱维亚",
											"Lebanon":"黎巴嫩",
											"Lesotho":"莱索托",
											"Liberia":"利比里亚",
											"Libya":"利比亚",
											"Lithuania":"立陶宛",
											"Luxembourg":"卢森堡",
											"Macedonia":"马其顿",
											"Madagascar":"马达加斯加",
											"Malawi":"马拉维",
											"Malaysia":"马来西亚",
											"Maldives":"马尔代夫",
											"Mali":"马里",
											"Malta":"马耳他",
											"Mauritania":"毛利塔尼亚",
											"Mauritius":"毛里求斯",
											"Mexico":"墨西哥",
											"Moldova":"摩尔多瓦",
											"Monaco":"摩纳哥",
											"Mongolia":"蒙古",
											"Montenegro":"黑山共和国",
											"Morocco":"摩洛哥",
											"Mozambique":"莫桑比克",
											"Myanmar":"缅甸",
											"Namibia":"纳米比亚",
											"Nepal":"尼泊尔",
											"Netherlands":"荷兰",
											"New Caledonia":"新喀里多尼亚",
											"New Zealand":"新西兰",
											"Nicaragua":"尼加拉瓜",
											"Niger":"尼日尔",
											"Nigeria":"尼日利亚",
											"Norway":"挪威",
											"Oman":"阿曼",
											"Pakistan":"巴基斯坦",
											"Panama":"巴拿马",
											"Papua New Guinea":"巴布亚新几内亚",
											"Paraguay":"巴拉圭",
											"Peru":"秘鲁",
											"Philippines":"菲律宾",
											"Poland":"波兰",
											"Portugal":"葡萄牙",
											"Puerto Rico":"波多黎各",
											"Qatar":"卡塔尔",
											"Reunion":"留尼旺",
											"Romania":"罗马尼亚",
											"Russia":"俄罗斯",
											"Rwanda":"卢旺达",
											"S. Geo. and S. Sandw. Is.":"南乔治亚和南桑威奇群岛",
											"S. Sudan":"南苏丹",
											"San Marino":"圣马力诺",
											"Saudi Arabia":"沙特阿拉伯",
											"Senegal":"塞内加尔",
											"Serbia":"塞尔维亚",
											"Sierra Leone":"塞拉利昂",
											"Singapore":"新加坡",
											"Slovakia":"斯洛伐克",
											"Slovenia":"斯洛文尼亚",
											"Solomon Is.":"所罗门群岛",
											"Somalia":"索马里",
											"South Africa":"南非",
											"Spain":"西班牙",
											"Sri Lanka":"斯里兰卡",
											"Sudan":"苏丹",
											"Suriname":"苏里南",
											"Swaziland":"斯威士兰",
											"Sweden":"瑞典",
											"Switzerland":"瑞士",
											"Syria":"叙利亚",
											"Tajikistan":"塔吉克斯坦",
											"Tanzania":"坦桑尼亚",
											"Thailand":"泰国",
											"Togo":"多哥",
											"Tonga":"汤加",
											"Trinidad and Tobago":"特立尼达和多巴哥",
											"Tunisia":"突尼斯",
											"Turkey":"土耳其",
											"Turkmenistan":"土库曼斯坦",
											"U.S. Virgin Islands":"美属维尔京群岛",
											"Uganda":"乌干达",
											"Ukraine":"乌克兰",
											"United Arab Emirates":"阿拉伯联合酋长国",
											"United Kingdom":"英国",
											"United States":"美国",
											"Uruguay":"乌拉圭",
											"Uzbekistan":"乌兹别克斯坦",
											"Vanuatu":"瓦努阿图",
											"Vatican City":"梵蒂冈城",
											"Venezuela":"委内瑞拉",
											"Vietnam":"越南",
											"W. Sahara":"西撒哈拉",
											"Yemen":"也门",
											"Yugoslavia":"南斯拉夫",
											"Zaire":"扎伊尔",
											"Zambia":"赞比亚",
											"Zimbabwe":"津巴布韦"
										}
									}
								]
							})
						}
					})
				});
			})
		</script>
	</body>
</html>